using System.Data;
using MetaObjects.Contracts;

namespace MetaObjects.Core
{
	public class DataColumnProvider : MetaFieldProvider<DataColumn>
	{
		protected override IMetaField GetMetaField(DataColumn field)
		{
			IMetaField metaField = new MetaDataColumn(field.ColumnName)
           	{
           		DisplayName = field.Caption,
           		ReadOnly = field.ReadOnly,
           		DefaultValue = field.DefaultValue,
           		Required = !field.AllowDBNull,
           	};
			return metaField;
		}
	}
}